import { Modal,Button } from 'antd';
import React from 'react';

class CapitalModal extends React.Component {
  state = {
    visible: false,
    text: '',
    data:'',
  };

  showModal = () => {
    this.setState({
      visible: true,
    });
  };

  handleOk = e => {
    console.log(e);
    this.setState({
      visible: false,
    });
  };

  handleCancel = e => {
    console.log(e);
    this.setState({
      visible: false,
    });
  };

  render() {
    return (
      <div>
        <a href='#!' onClick={this.showModal}>
          {this.props.text}
        </a>
        <Modal
          title="确认付款"
          visible={this.state.visible}
          onOk={this.handleOk}
          onCancel={this.handleCancel}
          footer={[
            <Button key="submit" type="primary" onClick={this.handleOk}>确定</Button>,
            <Button key="back" onClick={this.handleCancel}>取消</Button>,
          ]}
        >
          <p>编号：{this.props.data.bianhao}</p>
          <p>销售类型：</p>
          <p>金额合计：</p>
          <p>客户类型：</p>
          <p>客户名称：</p>
          <p>业务员：</p>
          <p>出库仓库：</p>
          <p>配送车辆：</p>
        </Modal>
      </div>
    );
  }
}

export default CapitalModal;